<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>电影列表页面</title>
    <link href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
</head>
<body>
<div class="container">
    <div class="text" style="margin-top: 20px;margin-left: 40%"><h1>电影列表页面</h1></div>
    <div class="text" style="..."><a >学号：1604220535</a><br>姓名：杨友奇</br></div>

    <div class="row" style="margin-top: 10px">
        <div class="col-2">
            <div class="list-group">
                <a class="list-group-item list-group-item-action active" th:href="@{/movie/index}">电影管理</a>
                <a class="list-group-item list-group-item-action" th:href="@{/actor/index}" >演员管理</a>
            </div>
        </div>


    <div class="col">
        <a class="btn btn-primary" th:href="@{/movie/add}">新增电影</a>
        <table class="table table-striped">
            <thead>
            <tr>
                <th scope="col">#</th>
                <th scope="col">电影名称</th>
                <th scope="col">封面</th>
                <th scope="col">发行日期</th>
                <th scope="col">角色数量</th>
                <th scope="col">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="movie,movieStat : ${list}">
                <td th:text="${movieStat.index + 1}"></td>
                <td th:text="${movie.name}"></td>
                <td th:text="${movie.photo}"></td>
                <td th:text="${movie.createDate} ? ${#dates.format(movie.createDate,'yyyy-MM-dd')} :''"></td>
                <td th:text="${#lists.size(movie.roles)}"></td>
                <td>
                    <a th:href="@{/movie/detail/{movieId}(movieId=${movie.id})}">详情</a>
                    <a th:href="@{/movie/edit/{movieId}(movieId=${movie.id})}">编辑</a>.
                    <a th:href="@{/movie/delete/{movieId}(movieId=${movie.id})}">删除</a>

                </td>
            </tr>
            </tbody>

        </table>
    </div>




</div>
</div>
</body>
</html>

